package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class ThreeLoginMethods extends BaseMethods {

    private static ThreeLoginMethods m_ins = null;

    public static ThreeLoginMethods getInstance() {
        if (m_ins == null) {
            synchronized (ThreeLoginMethods.class) {
                if (m_ins == null) {
                    m_ins = new ThreeLoginMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Personal/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void oauthLogin(Subscriber<Object> subscriber,
                      int  uid ,
                      String hashid  ,int type  ,String authId   ,String authName   ,String authHead   ,String gender     ) {
        Observable observable = initService().bind(System.currentTimeMillis()+"",
                "e235f95e68362ea7d6cf57dbaae59eea",uid,hashid,type,authId,authName,authHead,gender
        );
        toSubscribe(observable, subscriber);
    }
}
